<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 2-10-2010 18:49
 */

if ( ! defined( 'NV_IS_FILE_ADMIN' ) ) die( 'Stop!!!' );
if (!defined('CP_PERMISSION_TABLE')) {
    define('CP_PERMISSION_TABLE', 'cp_permissions');
}
$pid = $nv_Request->get_int( 'pid', 'post', 0 );
$mod = $nv_Request->get_string( 'mod', 'post', '' );
$new_vid = $nv_Request->get_int( 'new_vid', 'post', 0 );
$content = "NO_" . $catid;

$query = "UPDATE `".CP_PERMISSION_TABLE."`  ";
if($mod=="can_write"){
    $query .="SET `can_write`=".$new_vid;
}
else{
    $query .="SET `can_publish`=".$new_vid;
}

$query .= " WHERE `pid`=".$pid;

$db->sql_query( $query );
$content = "OK";

include ( NV_ROOTDIR . "/includes/header.php" );
echo $content;
include ( NV_ROOTDIR . "/includes/footer.php" );

?>